package com.ruoyi.storeSource.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.storeSource.mapper.StoreSourceMapper;
import com.ruoyi.storeSource.domain.StoreSource;
import com.ruoyi.storeSource.service.IStoreSourceService;

/**
 * 门店图片视频Service业务层处理
 *
 * @author ch
 * @date 2021-11-25
 */
@Service
public class StoreSourceServiceImpl implements IStoreSourceService
{
    @Autowired
    private StoreSourceMapper storeSourceMapper;

    /**
     * 查询门店图片视频
     *
     * @param id 门店图片视频主键
     * @return 门店图片视频
     */
    @Override
    public StoreSource selectStoreSourceById(Long id)
    {
        return storeSourceMapper.selectStoreSourceById(id);
    }

    /**
     * 查询门店图片视频列表
     *
     * @param storeSource 门店图片视频
     * @return 门店图片视频
     */
    @Override
    public List<StoreSource> selectStoreSourceList(StoreSource storeSource)
    {
        return storeSourceMapper.selectStoreSourceList(storeSource);
    }

    /**
     * 新增门店图片视频
     *
     * @param storeSource 门店图片视频
     * @return 结果
     */
    @Override
    public int insertStoreSource(StoreSource storeSource)
    {
        storeSource.setCreateTime(DateUtils.getNowDate());
        return storeSourceMapper.insertStoreSource(storeSource);
    }

    /**
     * 修改门店图片视频
     *
     * @param storeSource 门店图片视频
     * @return 结果
     */
    @Override
    public int updateStoreSource(StoreSource storeSource)
    {
        storeSource.setUpdateTime(DateUtils.getNowDate());
        return storeSourceMapper.updateStoreSource(storeSource);
    }

    /**
     * 批量删除门店图片视频
     *
     * @param ids 需要删除的门店图片视频主键
     * @return 结果
     */
    @Override
    public int deleteStoreSourceByIds(Long[] ids)
    {
        return storeSourceMapper.deleteStoreSourceByIds(ids);
    }


    /**
     * 批量逻辑删除门店图片视频
     *
     * @param ids 需要删除的门店图片视频主键
     * @return 结果
     */
    @Override
    public int logicDeleteStoreSource(Long[] ids,String delType,Long delUser)
    {
        return storeSourceMapper.logicDeleteStoreSource(ids,delType,delUser);
    }

    /**
     * 删除门店图片视频信息
     *
     * @param id 门店图片视频主键
     * @return 结果
     */
    @Override
    public int deleteStoreSourceById(Long id)
    {
        return storeSourceMapper.deleteStoreSourceById(id);
    }
    @Override
    public List<String> listStoreSourceGroupType(Long storeId){
        return storeSourceMapper.listStoreSourceGroupType(storeId);
    }
}
